﻿#include "stdafx.h"

#include "labeling.hpp"
#include <cstdint>

#define LABELING_MATELIALIZE(_Ts, _Tl, NAME)                                  \
                                                                              \
NAME::NAME(size_t label_size_estimate, int limit_type, int limit)             \
{                                                                             \
  labeling = new LabelingImpl<_Ts, _Tl>(label_size_estimate, limit_type, limit);  \
}                                                                             \
                                                                              \
NAME::~NAME() {delete labeling;}                                              \
                                                                              \
void NAME::Exec(const source_mat &src, label_mat &dst) {                      \
  return labeling->Exec(src, dst);                                            \
};                                                                            \
                                                                              \
const NAME::RegionInfoVec NAME::getRegions() {                                \
  return labeling->GetRegions();                                              \
}                                                                             \

namespace cv{
namespace Labeling{

	typedef LabelingImpl LabelingBS;
//LABELING_MATELIALIZE(uint8_t,  uint8_t,  LabelingBB);
//LABELING_MATELIALIZE(uint8_t,  uint16_t, LabelingBS);
//LABELING_MATELIALIZE(uint8_t,  uint32_t, LabelingBL);
//LABELING_MATELIALIZE(uint16_t, uint8_t,  LabelingSS);
//LABELING_MATELIALIZE(uint16_t, uint16_t, LabelingSB);
//LABELING_MATELIALIZE(uint16_t, uint32_t, LabelingSL);
//LABELING_MATELIALIZE(uint32_t, uint8_t,  LabelingLS);
//LABELING_MATELIALIZE(uint32_t, uint16_t, LabelingLB);
//LABELING_MATELIALIZE(uint32_t, uint32_t, LabelingLL);
}
}